home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / self / contrib.lha / contrib / 491 / aa / boundedNum.tests.self < prev    next >
Encoding:
Text File  |  1993-05-14  |  1.3 KB  |  32 lines

  1. "
  2. #
  3. # This is a set of regression tests for the boundedNum objects.
  4. #
  5. # boundedNum.tests.self,v 1.1 1993/05/14 22:44:03 richards Exp
  6. #
  7. # boundedNum.tests.self,v
  8. * Revision 1.1  1993/05/14  22:44:03  richards
  9. * Initial revision
  10. *
  11. #
  12. #
  13. "
  14.  
  15. _AddSlotsIfAbsent: (| bnumTests. |)
  16. bnumTests _AddSlotsIfAbsent: (| foo. bar. |)
  17.  
  18. bnumTests foo: aa bnum copy value: 10
  19. ('Test 1: ', ((bnumTests foo printString)              = 'Bnum<-Inf|Inf>: 10') printString) printLine
  20. ('Test 2: ', ((bnumTests foo lower: 40) printString    = 'Bnum<40|Inf>: 10')   printString) printLine
  21. ('Test 3: ', ((bnumTests foo upper: 100) printString   = 'Bnum<40|100>: 10')   printString) printLine
  22. ('Test 4: ', ((bnumTests foo value: 10)  printString   = 'Bnum<40|100>: 40')   printString) printLine
  23. ('Test 5: ', ((bnumTests foo value: 1000) printString  = 'Bnum<40|100>: 100')  printString) printLine
  24. (bnumTests bar: bnumTests foo - 100) 
  25. ('Test 6: ', ((bnumTests bar) printString              = 'Bnum<40|100>: 40')   printString) printLine
  26. (bnumTests foo: bnumTests foo * 0.5) 
  27. ('Test 7: ', ((bnumTests foo) printString              = 'Bnum<40|100>: 50.0') printString) printLine
  28. (bnumTests foo: bnumTests foo * 0.5) 
  29. ('Test 8: ', ((bnumTests foo) printString              = 'Bnum<40|100>: 40')   printString) printLine
  30. _RemoveSlot: 'bnumTests'
  31.  
  32.